/* 
 * javascript library for defining the editor panel and functions
 */


	// == a checkbox has been clicked ==
    function boxclick(box, name) {
    	      if (box.checked) {
    	          show();
    	        } else {
    	          hide();
    	        }
    	        // == rebuild the side bar
    	        makeSidebar();
    }	
    
    // == rebuilds the sidebar to match the markers currently displayed ==
    function makeSidebar() {
      var html = "";
      for (var i=0; i<gmarkers.length; i++) {
        if (!gmarkers[i].isHidden()) {
          html += '<a href="javascript:myclick(' + i + ')">' + gmarkers[i].getLatLng() + '<\/a><br>';
        }
      }
      document.getElementById("side_bar").innerHTML = html;
    }

	/*
	 * function to get the center point of GMap, used for bookmarking a place
	 */
    function getCenter() {
		var centerText = document.getElementById("center_text");
		centerText.innerHTML = "Center : " + map.getCenter() + " Zoom : "
				+ map.getZoom();
    }
    
    /*
     * update the map info panel with the information from the map
     */
	function updateMapInfo() {			
	    var currentLevel = document.getElementById("current_level");
		currentLevel.innerHTML = "Current Level : " +  map.getZoom();			
	}